package com.example.yunJie.digitalSentry.service.impl;

import com.example.yunJie.digitalSentry.entity.PostEntity;
import com.example.yunJie.digitalSentry.mapper.one.PostMapper;
import com.example.yunJie.digitalSentry.service.PostService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
@RequiredArgsConstructor
public class PostServiceImpl implements PostService {


    private final PostMapper postMapper;

    @Override
    public int insert(PostEntity postEntity) {
        return postMapper.insert(postEntity);
    }

    @Override
    public int update(PostEntity postEntity) {
        return postMapper.update(postEntity);
    }

    @Override
    public int deleteById(Serializable id) {
        return postMapper.deleteById(id);
    }

    @Override
    public int deleteIdList(List<Integer> idList) {
        return postMapper.deleteIdList(idList);
    }

    @Override
    public PostEntity findId(String id) {
        return postMapper.findId(id);
    }

    @Override
    public List<PostEntity> findAll() {
        return postMapper.findAll();
    }

    @Override
    public List<PostEntity> findByMarketName(String s) {
        return postMapper.findByMarketName(s);
    }

    @Override
    public PostEntity findIdByPostName(String postName) {
        return postMapper.findIdByPostName(postName);
    }
}
